package cn.stylefeng.guns.modular.demo.service;

import cn.stylefeng.guns.modular.demo.constant.FileCons;
import cn.stylefeng.guns.modular.demo.utils.FileUtil;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * 培训作业
 */
@Service
public class DemoService {

    /**
     * 文件上传
     * @param file
     * @return
     */
    public Map<String, Object> uploads(MultipartFile file){
        Map<String, Object> res = FileUtil.upload(file, FileCons.FILE_PATH, FileCons.FILE_MODULES);
        return res;
    }


}
